package cn.dkk.behavior_design.state.after;

/**
 * @author dkk
 * @date 2022/7/26
 * @desc
 */
public class Context {

    public final static OpeningState OPENING_STATE=new OpeningState();
    public final static StoppingState STOPPING_STATE=new StoppingState();
    public final static RunningState RUNNING_STATE=new RunningState();
    public final static ClosingState CLOSING_STATE=new ClosingState();

    private LeftState state;

    public LeftState getState() {
        return state;
    }

    public void setState(LeftState state) {
        this.state = state;
        this.state.setContext(this);
    }

    public void open(){
        this.state.open();
    }

    public void close(){
        this.state.close();
    }

    public void run(){
        this.state.run();
    }

    public void stop(){
        this.state.stop();
    }

}
